﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Liang.Util
{
    public class InitControl
    {
        public static void InitComboBox<T>(ComboBox cmbBox)
        {
            foreach (var item in Enum.GetValues(typeof(T)))
            {
                string strDescription = Propety.GetDescription<T>(item.ToString());
                cmbBox.Items.Add(strDescription);
            }

            if (0 != cmbBox.Items.Count)
            {
                cmbBox.SelectedIndex = 0;
            }
        }
    }
}
